package commands;
import java.util.HashMap;
import java.util.Set;

public class Commandable
{
  private HashMap<String, Commands> commands;
  
  public Commandable()
  {
    commands = new HashMap<String, Commands>();
  }
  
  public String executeVerb(String verb)
  {
    Commands c = commands.get(verb);
    return (c == null ? "" : c.runCommands());
  }
  
  public Commands addVerb(String verb)
  {
    Commands c = new Commands();
    commands.put(verb, c);
    return c;
  }
  
  public Commands removeVerb(String verb)
  {
    Commands c = commands.remove(verb);
    return c;
  }
  
  public Commands getVerbCommands(String verb)
  {
    return commands.get(verb);
  }
  
  public Set<String> getVerbs()
  {
    return commands.keySet();
  }
}
